package HomeWork;

import java.io.File;
import java.io.FileFilter;
import java.util.Scanner;

public class HemoWork03 {
    public static void main(String[] args) {
        File file = new File("./");
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入一个关键字：");
        String str = scan.next();
        File[] files = file.listFiles(f->f.getName().contains(str));
        System.out.println("该目录下共有如下包含字母"+str+"的文件！");
        for(File f :files){
            System.out.println(f.getName());
        }
    }
}
